﻿using VisualWip.Core;
using VisualWip.Core.Columns;
using VisualWip.Core.Interfaces;

namespace VisualWip.TFS2010Providers
{
    public class TfsWorkDoneSettingsViewModel : TfsWorkDualQuerySettingsViewModelBase<WorkDoneColumn>
    {
        public TfsWorkDoneSettingsViewModel(Application application, WorkDoneColumn column,
                                                IWorkItemProviderFactory workItemProviderFactory, IWorkItemSizeProvider workItemSizeProvider,
                                                    IColumnTypeProvider columnTypeProvider)
            : base(application, column, workItemProviderFactory,workItemSizeProvider,columnTypeProvider)
        {
        }

        public override string SettingsWindowName
        {
            get { return "Done column"; }
        }

        protected override void DownloadDisplayFieldsOnlyHasChanged()
        {
            var firstQuery = Column.FirstQuery as WorkItemQueryBase;
            var secondQuery = Column.SecondQuery as WorkItemQueryBase;

            if (firstQuery != null)
                firstQuery.DownloadDisplayFieldsOnly = DownloadDisplayFieldsOnly;
            if (secondQuery != null)
                secondQuery.DownloadDisplayFieldsOnly = DownloadDisplayFieldsOnly;
        }

    }
}